//
//  KeyBoardManager.h
//
// Copyright (c) 2013 Iftekhar Qurashi.
//
//使用方法：在AppDelegate中写入[IQKeyBoardManager installKeyboardManager];
#import <Foundation/Foundation.h>

@interface IQKeyBoardManager : NSObject
{
    //TextField or TextView object.
    UIView *textFieldView;
    
    CGFloat animationDuration;
    BOOL keyboardShow;
}

//Call it on your AppDelegate;
+(void)installKeyboardManager;

+(void)setTextFieldDistanceFromKeyboard:(CGFloat)distance;  /*can't be less than zero. Default is 10.0*/

+(void)enableKeyboardManger;    /*default enabled*/

+(void)disableKeyboardManager;

@end


/*Additional Function*/
@interface UITextField (ToolbarOnKeyboard)

//Helper functions to add Done button on keyboard.
-(void)addDoneOnKeyboardWithTarget:(id)target action:(SEL)action;

//Helper function to add SegmentedNextPrevious and Done button on keyboard.
-(void)addPreviousNextDoneOnKeyboardWithTarget:(id)target previousAction:(SEL)previousAction nextAction:(SEL)nextAction doneAction:(SEL)doneAction;

//Helper methods to enable and desable previous next buttons.
-(void)setEnablePrevious:(BOOL)isPreviousEnabled next:(BOOL)isNextEnabled;


@end

@interface IQSegmentedNextPrevious : UISegmentedControl
{
    id buttonTarget;
    SEL previousSelector;
    SEL nextSelector;
}
-(id)initWithTarget:(id)target previousSelector:(SEL)pSelector nextSelector:(SEL)nSelector;

@end
